#!/usr/bin/python
# -*- coding: UTF-8 -*-
from kptest.config.enum import HostType

from extension.test_logic.DpuLogic import DpuLogic


class DPU2_FUNCTION_056(DpuLogic):
    """
        Name:
            DPU2_FUNCTION_058
        Label:
           创建新用户, 设置用户密码, 启动用户，设置用户权限，开启用户远程ipmi命令功能
        PreCondition:

        TestStep:
            创建新用户, 设置用户密码, 启动用户，设置用户权限，开启用户远程ipmi命令功能
        ExpectedResult:
            A) soc系统/远程机带内/带外可以创建新用户, 设置用户密码, 启动/禁用用户，设置用户权限，开启用户远程ipmi命令功能
        Parameters:

        Author:
            HK1342
        Last Modified:
            2025/05/09
        Remark:

    """

    # 测试执行前配置等准备操作
    def pre_test_case(self):
        super().pre_test_case()

    # 测试步骤
    def procedure(self):
        self.log_step("Step1: 带外修改SOC系统启动项")
        self.set_dpu_boot_flag(boot_flag="force_pxe")

        self.log_step("Step2: 带外修改SOC系统默认启动项")
        self.set_dpu_boot_flag(boot_flag="none")

        self.log_step("Step3: 带外查询SOC系统启动项")
        boot_dev = self.get_dpu_boot_flag()
        self.assertEqual(boot_dev, "force_pxe", "boot_dev is not force_pxe")
        default_boot_dev = self.get_dpu_boot_flag()
        self.assertEqual(default_boot_dev, "none", "boot_dev is not none")

    # 测试结束后恢复环境
    def post_test_case(self):
        pass
